"""
@author: Sergiy Tsymbalyuk
"""

import logging

from repoze.what.plugins.pylonshq import ControllerProtector
from repoze.what.predicates import has_permission

from chowa.lib.site.crud import FlatCrudController
from catalogue.model.catalog import DocumentType

log = logging.getLogger(__name__)

@ControllerProtector(has_permission('catalogue.administer.types'))
class DoctypesController(FlatCrudController):
    __model__ = DocumentType
    __columns__ = ['name']
    __edit_columns__ = ['name', 'has_number']
